package com.base.component.ai.platform;

import java.util.function.Consumer;

import com.base.component.ai.platform.core.bo.common.ChatCompletionsBO;
import com.base.core.head.dto.ai.MessageBaseDTO;

import reactor.core.publisher.Flux;

public interface ChatCompletionsHandler<P extends MessageBaseDTO> extends BaseCompletionsHandler {

	/**
	 * 非流式
	 * @param param
	 * @return
	 */
	String execute(ChatCompletionsBO<P> param);
	
	/**
	 * 流式返回
	 * @param param
	 * @param frameConsumer
	 * @param successConsumer
	 */
	void execute(ChatCompletionsBO<P> param,Consumer<String> frameConsumer);
	
	/**
	 * 流式
	 * @param param
	 * @return
	 */
	default Flux<String> stream(ChatCompletionsBO<P> param){
		return null;
	}
	
}
